﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace China.Database.Migrations.Migrations
{
    public partial class v001 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.InsertData(
                table: "Role",
                columns: new[] { "Id", "Name", "Remark" },
                values: new object[] { 1, " 超级管理员", "最牛逼的人" });

            migrationBuilder.InsertData(
                table: "Role",
                columns: new[] { "Id", "Name", "Remark" },
                values: new object[] { 2, " 开发者", "一线码农" });

            migrationBuilder.InsertData(
                table: "User",
                columns: new[] { "Id", "Account", "Password" },
                values: new object[] { 1, "admin", "admin" });

            migrationBuilder.InsertData(
                table: "User",
                columns: new[] { "Id", "Account", "Password" },
                values: new object[] { 2, "dev", "dev123" });

            migrationBuilder.InsertData(
                table: "UserRole",
                columns: new[] { "RoleId", "UserId" },
                values: new object[] { 1, 1 });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "Role",
                keyColumn: "Id",
                keyValue: 2);

            migrationBuilder.DeleteData(
                table: "User",
                keyColumn: "Id",
                keyValue: 2);

            migrationBuilder.DeleteData(
                table: "UserRole",
                keyColumns: new[] { "RoleId", "UserId" },
                keyValues: new object[] { 1, 1 });

            migrationBuilder.DeleteData(
                table: "Role",
                keyColumn: "Id",
                keyValue: 1);

            migrationBuilder.DeleteData(
                table: "User",
                keyColumn: "Id",
                keyValue: 1);
        }
    }
}
